import { Random } from 'mockjs'
import { MockMethod } from 'vite-plugin-mock'
export default [
  {
    url: '/api/topic',
    method: 'get',
    response: () => {
      return {
        code: 200,
        message:"请求成功",
        status:"success",
        data: new Array(10).fill("").map((article,index)=>{
            return {
                id:index, //用户id
                img:'../../../public/imgs/tw.jpg',
                title:Random.ctitle(10),
                content:Random.cparagraph(20,50),
                time:`${index}用户更新于${ '一小时前'}`,
                //评论数
                comments:Math.floor(Math.random()*100),
                //点赞数
                good:Math.floor(Math.random()*100),

                //阅读数
                view:Math.floor(Math.random()*100)
            }
        })
      }
    },
  }
 
] as MockMethod[]